const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    entry: {"app": "./src/app.js","test":"./src/js/test.js"},
    output: {
        filename: "js/[name].js",
        path:path.resolve(__dirname, 'dist')
    },
    module:{
        loaders:[
            {
                test:/\.css$/,
                loader:'style-loader!css-loader'
            },
            {
                test:/\.js$/,
                loader:'babel-loader',
                include:path.resolve(__dirname,"src"),
                exclude:path.resolve(__dirname,"node_modules"),
                query: {
                    presets:[
                        "latest"
                    ]
                }
            }
        ]
    },
    plugins: [
        new htmlWebpackPlugin({
            filename: "index.html",
            template: "index.html",
            inject: 'body'
        })
    ]
}